/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package homework6;

/**
 *
 * @author Administrator
 */
import java.util.*;
class Student{
    private int no,math,eng,com;
    private String name;
    int total;
    double average;
    Student(int no,String name,int math,int eng,int com){
        this.no=no;
        this.name=name;
        this.math=math;
        this.eng=eng;
        this.com=com;
       }
    public int sum(){
        total=math+eng+com;
        return total;
       }
    public double average(){
        average=(double)(math+eng+com)/3;
        return average;
       }
    public void print(){
        System.out.printf("%d\t%s\t%d\t%d\t%d\t%d\t%.1f\n",no,name,math,eng,com,total,average);
       }
}
public class MainA {
     public static void main(String[] args) {
         Scanner cin=new Scanner(System.in);
         Student students[]=new Student[5];
         for(int i=0;i<5;i++){
             int no=cin.nextInt();
             String name=cin.next();
             int math=cin.nextInt();
             int eng=cin.nextInt();
             int com=cin.nextInt();
             students[i]=new Student(no,name,math,eng,com);
             students[i].sum();
             students[i].average();
         }
         System.out.println("Input the messages of five students(StudentID Name Math English Computer)");
         System.out.println();
         System.out.printf("StuID\tName\tMath\tEng\tCom\tTotal\tAverage\n");
         for(int i=0;i<5;i++){
             students[i].print();
          }
     }
}
